var pkid;

$(function() {
	$("#Button2").bind("click", function() {
				document.location = context + "/site/focalCompany/12.jsp";
			});

	var id = getParameter("12-1.js", "id");

	grooveTableSelectorI({
		id : id,
		columnName : "FC_INDENTID",
		tableName : "financialContract",
		handleType : "single",
		initFunc : function(indentBean) {
			new $.grooveViewPreII({
						id : id,
						primaryTable : "fcindent"
					}, "payfcorder", {
						formID : "formIndentView",
						beforecall : function() {
						},
						aftercall : function() {

						},
						rendercall : function(selfFunc, validator, validators,
								data, bean1) {
							new $.grooveView("addpayment", {
								formID : "formID",
								submitMessage : "确定提交支付",
								OKMessage : "成功完成订单支付",
								submitButtonID : "Button1",
								params : {
									idNumber : bean1.ID_NUMBER,
									idTotalpay : bean1.ID_TOTALPAY,
									fcnumber : (indentBean != null
											? indentBean.FC_NUMBER
											: ""),
									loanlabel : (indentBean != null ? "是" : "否"),
									loan : (indentBean != null ? "1" : "0"),
									indentID : id,
									inID : bean1.ID_SUPPLIERID,
									inName : bean1.ID_SUPPLIER
								},
								beforecall : function() {
								},
								aftercall : function() {
									document.location = context
											+ "/site/focalCompany/12.jsp"
								},
								rendercall : function(selfFunc, validator,
										validators, data2) {
									$("#PM_IDNUMBER").attr("readonly", true);
									$("#PM_LOAN").attr("readonly", true);
									$("#PM_LOANCTNUMBER")
											.attr("readonly", true);
								}
							});
						}
					});

		}
	});

	$("#pageloading").hide();
});